// /**
//  * Copyright © 2016 Magento. All rights reserved.
//  * See COPYING.txt for license details.
//  */

//
//  Variables
//  _____________________________________________

@account-nav-background: @sidebar__background-color;
@account-nav-color: false;

@account-nav-current-border: 3px solid transparent;
@account-nav-current-border-color: @color-orange-red1;
@account-nav-current-color: false;
@account-nav-current-font-weight: @font-weight__semibold;

@account-nav-item-hover: @color-gray91;

//
//  Common
//  _____________________________________________

& when (@media-common = true) {
#password-strength-meter-container {
    background-color: silver;
}

    .login-container {
        .block {
            &-new-customer {
                .actions-toolbar {
                    margin-top: 25px;
                }
            }

            .block-title {
                &:extend(.abs-login-block-title all);
                .lib-font-size(18);
            }
        }
    
        .fieldset {
            .lib-form-hasrequired(bottom);
            &:after {
                margin-top: 35px;
            }
        }
    }
    
    .block-addresses-list {
        .items.addresses {
            > .item {
                margin-bottom: @indent__base;
    
                &:last-child {
                    margin-bottom: 0;
                }
            }
        }
    }
    
    .form-address-edit {
        #region_id {
            display: none;
        }
    
        .actions-toolbar .action.primary {
            &:extend(.abs-button-l all);
        }
    }
    
    .form-edit-account {
        .fieldset.password {
            display: none;
        }
    }
    
    .box-billing-address,
    .box-shipping-address,
    .box-information,
    .box-newsletter {
        .box-content {
            line-height: 26px;
        }
    }

    //
    //  My account
    //  ---------------------------------------------

    .account {
        .column.main {
            h2 {
                margin-top: 0;
            }
    
            .toolbar {
                text-align: center;
                .limiter-options {
                    width: auto;
                }
            }
    
            .limiter {
                >.label {
                    &:extend(.abs-visually-hidden all);
                }
            }
    
            .block:not(.widget) {
                &:extend(.abs-account-blocks all);
            }
        }
    
        .sidebar-additional {
            margin-top: 40px;
        }
    
        .table-wrapper {
            &:last-child {
                margin-bottom: 0;
            }
    
            .action {
                margin-right: 15px;
    
                &:last-child {
                    margin-right: 0;
                }
            }
        }
    
        .table-return-items {
            .qty {
                .input-text {
                    &:extend(.abs-input-qty all);
                }
            }
        }
    }
    
    //  Checkout address (create shipping address)
    .field.street {
        .field.additional {
            .label {
                &:extend(.abs-visually-hidden all);
            }
        }
    }

    //
    //  Account navigation
    //  ---------------------------------------------

    .account-nav {
        .title {
            &:extend(.abs-visually-hidden all);
        }

        .content {
            .lib-css(background, @account-nav-background);
            padding: 15px 0;
        }

        .item {
            margin: 3px 0 0;

            &:first-child {
                margin-top: 0;
            }

            a,
            > strong {
                .lib-css(color, @account-nav-color);
                border-left: 3px solid transparent;
                display: block;
                padding: @indent__xs 18px @indent__xs 15px;
            }

            a {
                text-decoration: none;

                &:hover {
                    .lib-css(background, @account-nav-item-hover);
                }
            }

            &.current {
                a,
                strong {
                    .lib-css(border-color, @account-nav-current-border-color);
                    .lib-css(color, @account-nav-current-color);
                    .lib-css(font-weight, @account-nav-current-font-weight);
                }

                a {
                    .lib-css(border-color, @account-nav-current-border-color);
                }
            }
        }
    }

    //
    //  Blocks & Widgets
    //  ---------------------------------------------

    .block {
        &:extend(.abs-margin-for-blocks-and-widgets all);
        .column.main & {
            &:last-child {
                margin-bottom: 0;
            }
        }
    
        .title {
            margin-bottom: @indent__s;
    
            strong {
                .lib-heading(h4);
                .column.main & {
                    font-size: @h3__font-size;
                }
            }
        }

        p:last-child {
            margin: 0;
        }

        .box-actions {
            margin-top: @indent__xs;
        }
    }

.password-strength-meter-0 {
    background-color: red;
    width: 0%;
}

.password-strength-meter-1 {
    background-color: orange;
    width: 25%;
}

.password-strength-meter-2 {
    background-color: yellow;
    width: 50%;
}

.password-strength-meter-3 {
    background-color: yellowgreen;
    width: 75%;
}

.password-strength-meter-4 {
    background-color: green;
    width: 100%;
}
    
    .control.captcha-image {
        .lib-css(margin-top, @indent__s);
        .captcha-img {
            vertical-align: middle;
        }
    }
}

//
//  Mobile
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .account {
        .column.main,
        .sidebar-additional {
            margin: 0;
        }
    }
}

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
    .login-container {
        .fieldset {
            &:after {
                text-align: center;
            }
        }
    }

    .account {
        .page.messages {
            margin-bottom: @indent__xl;
        }

        .toolbar {
            &:extend(.abs-pager-toolbar-mobile all);
        }
    }

    .control.captcha-image {
        .captcha-img {
            .lib-css(margin-bottom, @indent__s);
            display: block;
        }
    }

    .customer-account-index {
        .page-title-wrapper {
            position: relative;
        }
    }
}

//
//  Desktop
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .login-container {
        &:extend(.abs-add-clearfix-desktop all);

        .block {
            &:extend(.abs-blocks-2columns all);
            &.login {
                .actions-toolbar {
                    > .primary {
                        margin-bottom: 0;
                        margin-right: @indent__l;
                    }

                    > .secondary {
                        float: left;
                    }
                }
            }
        }

        .fieldset {
            &:after {
                &:extend(.abs-margin-for-forms-desktop all);
            }

            > .field {
                > .control {
                    width: 55%;
                }
            }
        }
    }

    .form-create-account {
        .fieldset-fullname {
            .fields {
                .field {
                    float: left;
                    margin: 0 @indent__s @indent__s 0;
                }
            }

            .field-name-prefix,
            .field-name-suffix {
                width: 50px;
            }
        }
    }

    .form.password.reset,
    .form.send.confirmation,
    .form.password.forget,
    .form.create.account {
        min-width: 600px;
        width: 50%;
    }

    //
    //  My account
    //  ---------------------------------------------

    .account.page-layout-2columns-left {
        .sidebar-main,
        .sidebar-additional {
            width: 22.3%;
        }

        .column.main {
            width: 77.7%;
        }
    }

    .account {
        .column.main {
            .block:not(.widget) {
                .block-content {
                    &:extend(.abs-add-clearfix-desktop all);

                    .box {
                        &:extend(.abs-blocks-2columns all);
                    }
                }
            }
        }

        .toolbar {
            &:extend(.abs-pager-toolbar all);
        }
    }

    .block-addresses-list {
        .items.addresses {
            &:extend(.abs-add-clearfix-desktop all);

            > .item {
                &:extend(.abs-blocks-2columns all);
                margin-bottom: @indent__base;

                &:nth-last-child(1),
                &:nth-last-child(2) {
                    margin-bottom: 0;
                }
            }
        }
    }

    //
    //  Welcome block
    //  ---------------------------------------------

    .dashboard-welcome-toggler {
        &:extend(.abs-visually-hidden-desktop all);
    }

    .control.captcha-image {
        .captcha-img {
            margin: 0 @indent__s @indent__s 0;
        }
    }
}
